package com.example.liuyuming_

import android.os.Bundle
import android.widget.ArrayAdapter
import android.widget.ListView
import androidx.appcompat.app.AppCompatActivity
import java.io.Serializable

class HistoryActivity : AppCompatActivity() {
    private lateinit var listViewHistory: ListView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_history)

        listViewHistory = findViewById(R.id.listViewHistory)

        // 从 Intent 获取 historyList
        val historyList = intent.getSerializableExtra("HISTORY_LIST") as? List<String>
        historyList?.let {
            val adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, it)
            listViewHistory.adapter = adapter
        }
    }
}